﻿using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;

public class TimeScaler : EditorWindow
{
    [MenuItem("Help/Unity Prolongation/TimeScaler %w")]
    private static void ShowWindow()
    {
        var window = GetWindow<TimeScaler>();
        window.titleContent = new GUIContent("时间缩放工具（仅用于测试）");
        //window.autoRepaintOnSceneChange = true;
    }

    private void OnGUI()
    {
        if (GUI.RepeatButton(new Rect(10, 20, 180, 40), "时间缩放 x 1"))
        {
            Time.timeScale = 1;
        }
        if (GUI.RepeatButton(new Rect(200, 20, 180, 40), "时间缩放 x 4"))
        {
            Time.timeScale = 4;
        }
        if (GUI.RepeatButton(new Rect(10, 70, 180, 40), "时间缩放 x 8"))
        {
            Time.timeScale = 8;
        }
        if (GUI.RepeatButton(new Rect(200, 70, 180, 40), "时间缩放 x 16"))
        {
            Time.timeScale = 16;
        }
    }
}